home *** CD-ROM | disk | FTP | other *** search
- g <- Graph new "Graph is in AmigaTalk:User/Graph.st"
-
- g initialize: 'TestGraph' winTitle: 'TestGraphPaper'
-
- g open: 16r40D20001 from: 0@0 to: 640@480
-
- g setXAxisFrom: -10.0 to: 10.0 by: 0.1
- g setYAxisFrom: -100.0 to: 100.0 by: 1.0
-
- crs <- Colors new: 'TestGraphPaper'
-
- crs loadColors: 16 from: 'Amigatalk:AmigaTalk.colors'
- crs setWindowColorReg: 1 red: 12 green: 12 blue: 12
- crs setWindowColorReg: 2 red: 0 green: 0 blue: 8
- crs setWindowColorReg: 3 red: 8 green: 8 blue: 8
- crs setWindowColorReg: 4 red: 15 green: 0 blue: 15
- crs setWindowColorReg: 5 red: 0 green: 8 blue: 8
- crs setWindowColorReg: 6 red: 15 green: 15 blue: 0
-
- g drawGrid: 20 y: 20 color: 2
-
- g drawXAxis: 0.0 numTicks: 10 color: 4
- g drawYAxis: 0.0 numTicks: 10 color: 6
-
- g setPen: 1
-
- g drawLabel: 'y-axis' at: 325@12
- g drawLabel: 'x-axis' at: 580@230
-
- x1 <- 0.0
- y1 <- 0.0
-
- (-9.9 to: 10.0 by: 0.1) do: [:x| x1 <- x. y1 <- x * x. g plotPoint: x1 y: y1]
-
- g drawLabel: ('range: ', (g range asString)) at: 500@245
- g drawLabel: ('scale: ', (g xScale asString)) at: 500@255
-
- g drawLabel: ('domain: ',(g domain asString)) at: 325@24
- g drawLabel: ('scale: ', (g yScale asString)) at: 325@36
-
- g refreshGraphPaper
-